#ifndef __NV_L40_MEMORY_H__
#define __NV_L40_MEMORY_H__

#include "interface/memory.h"
#include <mc/engine.h>

namespace dev {

class nv_l40_memory : public mc::engine::object<nv_l40_memory> {
public:
    MC_OBJECT(nv_l40_memory, "Memory", "Memory/${DimmNum}", (Memory))

    nv_l40_memory()  = default;
    ~nv_l40_memory() = default;

    bool start();
    bool stop();
    bool init(mc::mutable_dict& csr_object, const mc::dict& connector);

    bool reset_default_properties();

    // NVIDIA显存特有方法
    bool read_memory_temperature();
    bool read_memory_ecc_status();
    bool read_memory_bandwidth();

    Memory m_memory;

    // NVIDIA显存扩展属性
    std::string m_memory_type;        // GDDR6, HBM2, HBM3等
    uint32_t    m_memory_bus_width;   // 显存位宽
    uint32_t    m_memory_bandwidth;   // 显存带宽 GB/s
    double      m_memory_temperature; // 显存温度
};

} // namespace dev

#endif // __nv_l40_MEMORY_H__
